<template>
  <div>
    <mt-header title="订单详情" fixed>
      <router-link to="/order" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
    </mt-header>
    <div class="detail">
      <ul>
        <li v-for="(detail, index) in detailList" :key="index">
          <img :src="'https://hycos-1257620396.file.myqcloud.com' + detail.goodsImagePath" alt="图片" width="60px">
          <div class="title">
            <p>{{detail.goodsTitle}}</p>
            <p>单价：<span class="money">￥{{detail.goodsDiscountPrice / 100}}</span></p>
            <p>数量：x{{detail.purchaseQuantity}}</p>
          </div>
          <p class="total">总价：<span class="money">￥{{detail.goodsDiscountTotal / 100}}</span></p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: 'order-detail',
  data () {
    return {
      url: {
        detail: '/distributor/invite/user/order/item/list'
      },
      detailList: []
    }
  },
  methods: {},
  created () {
    this.$ajax.post(this.url.detail, this.$route.query.id).then(res => {
      if (res.data.success) {
        this.detailList = res.data.data
      }
    })
  }
}
</script>

<style scoped>
  .detail{
    margin-top: 40px;
  }
  .detail li{
    overflow: hidden;
    list-style: none;
    padding: 10px;
    border-bottom: 1px solid #dddee1;
    position: relative;
  }
  .detail li img{
    float: left;
  }
  .title{
    float: left;
    margin-left: 10px;
    font-size: 12px;
  }
  .title p{
    line-height: 20px;
  }
  .title p:nth-child(1){
    font-size: 14px;
    line-height: 20px;
    color: #495060;
    font-weight: 700;
  }
  .total{
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 12px;
  }
  .money{
    color: #ed3f14;
    font-weight: 600;
  }
</style>
